package com.lzy.example.controller;


import com.lzy.example.entity.Student;
import com.lzy.example.repo.StudentRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Api(tags = "学生控制器")
@Controller
@RequestMapping("student")
public class StudentController {

    @Autowired
    private StudentRepository studentRepository;
    
    @ApiOperation(value = "添加", tags = "学生控制器")
    @PostMapping("add")
    public Student addStudent(Student student) {
        return studentRepository.save(student);
    }
}
